<?php

class AdminNewsDeleteController extends ApplicationController implements IExecutable 
{
    public function exec()
    {
        $NewsModel = new NewsModel(DbConnection::COMMON_SPACE, true);
        $NewsModel->prepare("DELETE FROM {$NewsModel->getTableName()} WHERE id = i:id")->exec(array('id' => Env::getParam('id')));
        
        Location::go('/admin/news/');
    }
}

?>